﻿/* 
 * author: www.cnblogs.com/luminji
 * date  : 2012/01/16
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;

namespace Luminji.Core.Web
{
    public sealed class WebPathHelper
    {
        /// <summary>
        /// if web is *, the result is *
        /// </summary>
        /// <returns></returns>
        public static string GetAppDomainAppPath()
        {
            return HttpRuntime.AppDomainAppPath.ToString();
        }

        public static string GetServerMapPath(Page page, string relativePath = "~/")
        {
            return page.Server.MapPath(relativePath);
        }

        public static string GetApplicationPath(Page page)
        {
            return page.Request.ApplicationPath;
        }
    }
}
